﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;

namespace ModubsRTUTempactureCurve.Converters
{
    public class VisibleConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is bool CanVisibility)
            {
                // 如果当前是 Visible，则返回 Collapsed；否则返回 Visible
                return CanVisibility == false ? Visibility.Collapsed : Visibility.Visible;
            }
            return Visibility.Collapsed; // 默认隐藏
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
